package com.sias.userservice.controller.inner;

import com.sias.model.model.entity.User;
import com.sias.serviceclient.service.UserFeignClient;
import com.sias.userservice.service.UserService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Collection;
import java.util.List;

/**
 * @author 吴文杰
 * @version 1.0
 * @since 2023/12/14 20:01
 */
@RestController
@RequestMapping("/inner")
public class UserInnerController implements UserFeignClient {

  @Resource
  UserService userService;

  @Override
  @GetMapping("/get/id")
  public User getById(@RequestParam("userId") long userId) {
    return userService.getById(userId);
  }

  @Override
  @PostMapping("/get/ids")
  public List<User> listByIds(@RequestParam("userIds") Collection<Long> userIds) {
    return userService.listByIds(userIds);
  }
}
